<template>
  <div>
    <ul>
      <li>
        <h1>{{ name }}</h1>
        <h3>{{ desc }}</h3>
        <p>
          <button @click="decrease(id)">-</button> 总共{{ num }}个<button
            @click="increase(id)"
          >
            +
          </button>
        </p>
      </li>
    </ul>
  </div>
</template>

<script>
  export default {
    name: "Item",
    data() {
      return {};
    },

    props: ["name", "desc", "id", "num", "increase", "decrease"],

    mounted() {
      console.log(this, "item"); //实例对象
    },
  };
</script>

<style></style>
